package com.cy.pj.sys.controller;

import com.cy.pj.sys.pojo.SysUser;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/")
public class PageController {
    @RequestMapping("doLogin")
    public String doIndexUI(){

        return "login";
    }
    @RequestMapping("doRegister")
    public String doRegister(){
        return "register";
    }
    @RequestMapping("doIndexUI")
    public String doGuanli(Model model){
        SysUser user =
                (SysUser) SecurityUtils.getSubject().getPrincipal();
        model.addAttribute("username", user.getUsername());

        return "khym";
    }

    @RequestMapping("doPageUI")
    public String doPageUI(){
        return "common/page";
    }
    @RequestMapping("{moduleUI}")
    public String doModuleUI(@PathVariable String moduleUI){
        return moduleUI;

    }


}
